Or what actuaries can learn from software engineers
Getting the same results from an analysis when the same data is used
Why would you want this?
Here are the five main things influencing an analysis’ reproducibility:
Source: Peng, Roger D. 2011. “Reproducible Research in Computational Science.” Science 334 (6060): 1226–27
R < 3.6 (set.seed(1234))
[1] 2 6 5 8 9
Python >= 3.6+
Hello, Alice!
{stringr} < 1.5.0:
NumPy < Prior 2008
Rarely an issue, but Neupane, et al. 2019:
While preparing a manuscript, to our surprise, attempts by team members to replicate these results produced different calculated NMR chemical shifts despite using the same Gaussian files and the same procedure outlined by Willoughby et al. […] these conclusions were based on chemical shifts that appeared to depend on the computer system on which step 15 of that protocol was performed.
Works on my machine!
We will all use your computer then.
IRA Report 2023We need to answer these questions
Create a virtual environment on a project by project basis:
Create a renv.lock file in 2 steps:
renv::init() and check the folder for renv.lock. (renv::init() will take some time to run the first time)Before you start a project, create a virtual environment in 5 steps. We will be using conda:
conda create --name <my-env>. Replace <my-env> with the name of your environment.conda activate <my-env> to activate the environment.conda list -e > requirements.txt.renv.lock file not just a recordrenv::restore() (answer Y to active the project when asked)requirements.txt file not just a recordconda create --name <env> --file requirements.txtbut… :
{targets} - R only_targets.R scripttargets::tar_visnetwork()_targets.R provides a clear view of what’s happening (beyond documentation)renv::init()renv.lock or requirements.txt file{targets}: not only good for reproducibility, but also an amazing tool all around